package homework;

/**
 * @classname:demo08
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/8 17:38
 * @version: 0.1
 * @since:1.8
 */
public class demo08 {
    public static void main(String[] args) {
        String str = "hanbasdnbafllgnbahjnbakqqqqlnbaxi";
        //限制分割可以避免删除最后的字符
        String[] nbas = str.split("nba",-1);
        System.out.println("字符串有"+(nbas.length-1)+"个nba");
    }
}
